<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
<head><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
    <title>6.47. Module-Init-Tools-3.2.2</title>
    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css" media="print" />
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head>
  <body id="lfs" class="6.2">
    <div class="navheader">
      <div class="headertitles">
        <h4>Linux From Scratch - 版本 6.2</h4>
        <h3>第六章 安装系统基础软件</h3>
      </div>
      <ul class="headerlinks">
        <li class="prev">
          <a accesskey="p" href="mktemp.html" title="Mktemp-1.5">后退</a>
          <p>Mktemp-1.5</p>
        </li>
        <li class="next">
          <a accesskey="n" href="patch.html" title="Patch-2.5.4">前进</a>
          <p>Patch-2.5.4</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter06.html" title="第六章 安装系统基础软件">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a></li>
      </ul>
    </div>
    <div class="wrap">
      <div class="titlepage">
        <h1 class="sect1">6.47. Module-Init-Tools-3.2.2</h1>
      </div>
      <div class="package">
        <p>Module-Init-Tools 包含处理 2.5.47 及以上版本的内核模块时使用的工具。</p>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">预计编译时间：</span></strong> <span class="seg">少于 0.1 SBU</span>
            </div>
            <div class="seg">
              <strong><span class="segtitle">所需磁盘空间：</span></strong> <span class="seg">7 MB</span>
            </div>
          </div>
        </div>
      </div>
      <div class="installation">
        <div class="titlepage">
          <h2 class="sect2">6.47.1. 安装 Module-Init-Tools</h2>
        </div>
        <p>首先更正一个当模块被指定使用正则表达式时会出现的潜在问题：</p>
        <pre class="userinput"><kbd class="command">patch -Np1 -i ../module-init-tools-3.2.2-modprobe-1.patch</kbd></pre>
        <p>执行下面的命令进行测试（注意 <span><strong class="command">make distclean</strong></span> 命令需要清理源码树，因为作为测试过程的一部分，源码会重新编译：</p>
        <pre class="userinput"><kbd class="command">./configure &amp;&amp;
make check &amp;&amp;
make distclean</kbd></pre>
        <p>为编译 Module-Init-Tools 做准备：</p>
        <pre class="userinput"><kbd class="command">./configure --prefix=/ --enable-zlib</kbd></pre>
        <p>编译软件包：</p>
        <pre class="userinput"><kbd class="command">make</kbd></pre>
        <p>安装软件包：</p>
        <pre class="userinput"><kbd class="command">make INSTALL=install install</kbd></pre>
        <div class="variablelist">
          <p class="title">
            <b>make 参数的含义：</b></p>
          <dl>
            <dt>
              <span class="term"><em class="parameter"><tt>INSTALL=install</tt></em></span>
            </dt>
            <dd>
              <p>正常情况下，如果二进制文件已经存在了，<span><strong class="command">make install</strong></span> 就不会安装它们。
                这个选项是调用 <span><strong class="command">install</strong></span> 而不是使用默认封装的脚本。</p>
            </dd>
          </dl>
        </div>
      </div>
      <div class="content">
        <div class="titlepage">
          <a id="contents-module-init-tools" name="contents-module-init-tools"></a>
          <h2 class="sect2">6.47.2. Module-Init-Tools 的内容</h2>
        </div>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">安装的程序：</span></strong> <span class="seg">depmod,
              generate-modprobe.conf, insmod, insmod.static, lsmod, modinfo,
              modprobe, rmmod</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3><a id="id3692810" name="id3692810"></a>简要描述</h3>
          <table border="0">
            <col align="left" valign="top" />
            <tbody>
              <tr>
                <td><a id="depmod" name="depmod"></a><span class="term"><span><strong class="command">depmod</strong></span></span></td>
                <td><p>创建一个可加载内核模块的依赖关系文件，<span><strong class="command">modprobe</strong></span> 用它来自动加载模块。</p></td>
              </tr>
              <tr>
                <td><a id="generate-modprobe.conf" name="generate-modprobe.conf"></a><span class="term"><span><strong class="command">generate-modprobe.conf</strong></span></span></td>
                <td><p>从一个现存的2.2 或者 2.4版本内核的模块设置中创建一个 modprobe.conf 文件</p></td>
              </tr>
              <tr>
                <td><a id="insmod" name="insmod"></a><span class="term"><span><strong class="command">insmod</strong></span></span></td>
                <td><p>向正在运行的内核加载模块</p></td>
              </tr>
              <tr>
                <td><a id="insmod.static" name="insmod.static"></a><span class="term"><span><strong class="command">insmod.static</strong></span></span></td>
                <td><p><span><strong class="command">insmod</strong></span> 的静态编译版本</p></td>
              </tr>
              <tr>
                <td><a id="lsmod" name="lsmod"></a><span class="term"><span><strong class="command">lsmod</strong></span></span></td>
                <td><p>显示当前已加载的内核模块信息</p></td>
              </tr>
              <tr>
                <td><a id="modinfo" name="modinfo"></a><span class="term"><span><strong class="command">modinfo</strong></span></span></td>
                <td><p>检查与内核模块相关联的目标文件，并打印出所有能得到的信息。</p></td>
              </tr>
              <tr>
                <td><a id="modprobe" name="modprobe"></a><span class="term"><span><strong class="command">modprobe</strong></span></span></td>
                <td><p>利用 <span><strong class="command">depmod</strong></span> 创建的依赖关系文件来自动加载相关的模块</p></td>
              </tr>
              <tr>
                <td><a id="rmmod" name="rmmod"></a><span class="term"><span><strong class="command">rmmod</strong></span></span></td>
                <td><p>从当前运行的内核中卸载模块</p></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="mktemp.html" title="Mktemp-1.5">后退</a>
          <p>Mktemp-1.5</p>
        </li>
        <li class="next">
          <a accesskey="n" href="patch.html" title="Patch-2.5.4">前进</a>
          <p>Patch-2.5.4</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter06.html" title="第六章 安装系统基础软件">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a>.
        </li>
      </ul>
    </div>
</body></html>
